/**
 * 总控台  财务中心，底部统计数
 */

const sumpay = require('../module/sumpay.js')
module.exports = {
    //统计本月充值 次数，金额
    sumorder: (req, res, next) => {
        sumpay.sumorder().then(results => {
            req.ors = results.ors
            req.sumors = results.sumors
            next()
        }).catch(err => {
            next(err)
        })
    },

    //统计本月支付  次数，金额
    sumendorder: (req, res, next) => {
        sumpay.sumendorder().then(resus => {
            req.ops = resus.ops
            req.sumops = resus.sumops
            next()
        }).catch(err => {
            next(err)
        })
    },

    //统计商户子账户余额   商户数，余额
    sumorpay: (req, res, next) => {
        sumpay.sumorpay().then(resuls => {
            req.oms = resuls.oms
            req.sumoms = resuls.sumoms
            next()
        }).catch(err => {
            next(err)
        })
    }


}